package cn.roadtrip.utilmodule.util.enumpck;

/**
 * 票据类型
 */
public enum Enum_TicketRangeType {
    Point("Point", "指定商品"),
    All("All", "所有产品"),
    ;
    private String s;
    private String title;

    Enum_TicketRangeType(String s, String title) {
        this.s = s;
        this.title = title;
    }

    Enum_TicketRangeType(String s) {
        this.s = s;
        this.title = cn.roadtrip.utilmodule.util.enumpck.Enum_ShopType.parseCode(s).getTitle();
    }

    public String getTitle() {
        return this.title;
    }

    public String getCode() {
        return this.s;
    }


    public static final Enum_TicketRangeType parseCode(String code) {
        switch (code) {
            case "Point":
                return Point;
            case "All":
                return All;
        }
        return null;
    }

    @Override
    public String toString() {
        return "(code:%s, title:%s)".formatted(this.s, this.title);
    }

}
